<template>
	<view class="container" style="background-color: #fff;">
		<form @submit="formSubmit" @reset="formReset">
			<view class="my-add-bank-card-box">
				<view class="floor">
					<view class="title">
						报事单号
					</view>
					<view class="content">
						{{dict.no}}
					</view>
				</view>
				<view class="floor">
					<view class="title">
						报事标题
					</view>
					<view class="content">
						{{dict.title}}
					</view>
				</view>
				<view class="floor">
					<view class="title">
						数据来源
					</view>
					<view class="content">
						{{dict.client}}
					</view>
				</view>
				<view class="floor">
					<view class="title">
						报事分类
					</view>
					<view class="content">
						{{dict.applyCategory}}
					</view>
				</view>
				<view class="floor">
					<view class="title">
						报事电话
					</view>
					<view class="content">
						{{dict.applyPhone}}
					</view>
				</view>
				<view class="floor">
					<view class="title">
						报事者姓名
					</view>
					<view class="content">
						{{dict.applyName}}
					</view>
				</view>
				<view class="floor">
					<view class="title">
						报事时间
					</view>
					<view class="content">
						{{dict.createTime.replace("T"," ")}}
					</view>
				</view>
				<!-- <view class="floor">
					<view class="title">
						房间编号
					</view>
					<view class="content">
						{{dict.applyHouse}}
					</view>
				</view> -->
				<view class="floor">
					<view class="title">
						流程状态
					</view>
					<view class="content">
						{{dict.state}}
					</view>
				</view>
			</view>
		</form>
	</view>
</template>

<script>
	import {
		flowComplaintsIinsert
	} from "@/api/home.js"
	export default {
		data() {
			return {
				data: {},
				array: ['PC', '小程序'],
				array1: ['环境', '事务', '其他'],
				index: 0,
				index1: 0,
				picList: [
					"/static/60x60.png",
					"/static/c1.png",
					"/static/c2.png",
					"/static/60x60.png",
					"/static/c1.png",
					"/static/c2.png"
				],
				dict: {}
			}
		},
		onLoad(t) {
			this.dict = JSON.parse(t.detail);
		},
		methods: {
			picker1(e) {
				console.log(e)
				this.index = e.detail.value
				this.data.client = e.detail.value
			},
			picker2(e) {
				console.log(e)
				this.index1 = e.detail.value
				this.data.applyCategory = e.detail.value
			},
			submit() {
				var data = this.address
				flowComplaintsIinsert(data).then(res => {
					uni.stopPullDownRefresh();
					if (res.code == 200) {
						console.log('提交成功')
						// 返回上一页
						uni.navigateBack({
							delta: 1 // 默认值是1，表示返回的页面层数
						});
					}
				}).catch(err => {
					console.log('提交失败')
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	uni-input {
		height: 70rpx !important;
		line-height: 70rpx !important;
	}

	.floor {
		width: 100%;
		overflow: hidden;
		margin-bottom: 5px;

		.title {
			float: left;
			width: 120px;
			line-height: 70rpx;
			text-align: center;
			font-size: 28rpx;
			color: #666666;
			background-color: #fff;
		}

		.content {
			float: left;
			width: calc(100% - 140px);
			height: 70rpx;
			line-height: 70rpx;
			border-bottom: 1px solid #ccc;
			padding: 0 10px;

			uni-button {
				width: 50px;
				height: 50px;
				display: block;
				float: left;
				margin: 10px;
			}

			uni-image {
				width: 50px;
				height: 50px;
				display: block;
				float: left;
				margin: 10px;
			}
		}
	}
</style>